| IdeaBlade.Linq Assembly > IdeaBlade.Linq Namespace > PredicateBuilder Class > And Method : And<T>(Expression<Func<T,Boolean>>[]) Method |
'DeclarationPublic Overloads Shared Function And(Of T)( _ ByVal ParamArray expressions() As Expression(Of Func(Of T,Boolean)) _ ) As Expression(Of Func(Of T,Boolean))
'UsageDim expressions() As Expression(Of Func(Of T,Boolean)) Dim value As Expression(Of Func(Of T,Boolean)) value = PredicateBuilder.And(Of T)(expressions)
public static Expression<Func<T,bool>> And<T>( params Expression<Func<T,bool>>[] expressions )
public void AndQuery() { var mgr = new DomainModelEntityManager(); Expression<Func<Customer, bool>> crit1 = c => c.Country.Equals("Mexico"); Expression<Func<Customer, bool>> crit2 = c => c.CompanyName.StartsWith("A"); Expression<Func<Customer, bool>> crit3 = c => c.City.StartsWith("M"); // 'and' all criteria. var finalcrit = PredicateBuilder.And(crit1, crit2, crit3); var results = mgr.Customers.Where(finalcrit).ToList(); }
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2